package com.jinhongone.pattern.behavior.visitor.staticDispatch;


/**
 * @author jinho
 * @className Test
 * @description todo 类描述
 * @date 2025/4/17 10:56
 */
public class Test {

    public static void main(String[] args) {

        Animal a = new Animal();
        Animal d = new Dog();
        Animal c = new Cat();
        Execute e = new Execute();
        e.execute(a);
        e.execute(d);
        e.execute(c);
        /*animal
        animal
        animal*/
//        结论：接受者Execute是动态分派，但方法接受的实参是按照参数的静态类型找的对应重载方法。
    }
}
